import  request  from "@/utils/axios";
import appName from "../appName"
const timeout = 900000;



// 查询左侧体检检查库项目列表
export function getExamProjectLibraryList() {
  return request({
    url: appName.AUSCONFING + '/aus/medicalLibrary/getExamProjectLibraryList',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

//获取规则配置菜单列表
export function getRuleConfigMenuApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/ruleConfig/getRuleConfigMenu',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

//查询疾病下拉列表
export function getDiseaseListApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/ruleConfig/getDiseaseList',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 新增疾病规则：
export function addRuleConfigMenuApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/ruleConfig/addRuleConfigMenu',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除疾病规则：
export function delRuleConfigMenuApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/ruleConfig/delRuleConfigMenu?id='+params,
    method: 'post',
    timeout:timeout
  })
}

/* ---体检风险项  start */
// 体检风险规则
export function getPhysicalRiskRuleApi(params) {
  let url = '/aus/physicalRiskRule/getPhysicalRiskRule'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 删除体检风险规则
export function delPhysicalRiskRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalRiskRule/delPhysicalRiskRule?diseaseRuleID=' + params,
    method: 'post',
    timeout:timeout
  })
}

// 体检风险规则保存（覆盖）
export function savePhysicalRiskRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalRiskRule/savePhysicalRiskRule',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 体检风险规则保存（新版本）
export function saveNewPhysicalRiskRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalRiskRule/saveNewPhysicalRiskRule',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查看体检风险规则所有版本
export function getPhysicalRiskRuleVersionApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalRiskRule/getPhysicalRiskRuleVersion',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 导出风险规则
export function importPhysicalRiskRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalRiskRule/importPhysicalRiskRule',
    method: 'post',
    data: params,
    responseType: 'blob',
    timeout:timeout
  })
}

// 查询体检项对象.项目大类
export function getProjectCategoryApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalRiskRule/getProjectCategory',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查询体检项对象.项目名称
export function getProjectNameApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalRiskRule/getProjectName',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查询体检项对象.测量结果
export function getMeasurementResultTypeOneApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/physicalRiskRule/getMeasurementResultTypeOne?id=' + params,
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查询体检项对象.测量结果
export function getMeasurementResultApi(params) {
  let url = '/aus/physicalRiskRule/getMeasurementResult'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 查询体检项对象.测量结果类型
export function getMeasurementResultTypeApi(params) {
  let url = '/aus/physicalRiskRule/getMeasurementResultType'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 查询体检项单位列表
export function getMeasurementUnitApi(params) {
  let url = '/aus/physicalRiskRule/getMeasurementUnit'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 根据项目名称id查询病症实体属性
export function getDiseaseEntityAttributeApi(params) {
  let url = '/aus/general/getDiseaseEntityAttribute'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 根据属性ID查询属性分类
export function getAttributeSortApi(params) {
  let url = '/aus/general/getAttributeSort'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

/* end */

/* ---健康风险项  start */
// 健康风险项规则
export function getHealthRiskRuleApi(params) {
  let url = '/aus/healthRiskRule/getHealthRiskRule'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 删除健康风险规则
export function delHealthRiskRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/healthRiskRule/delHealthRiskRule?diseaseRuleID=' + params,
    method: 'post',
    timeout:timeout
  })
}

// 健康风险项规则保存（覆盖）
export function saveHealthRiskRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/healthRiskRule/saveHealthRiskRule',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 健康风险项规则保存（新版本）
export function saveNewHealthRiskRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/healthRiskRule/saveNewHealthRiskRule',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查看健康风险项规则所有版本
export function getHealthRiskRuleVersionApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/healthRiskRule/getHealthRiskRuleVersion',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 导出健康风险项规则
export function importHealthRiskRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/healthRiskRule/importHealthRiskRule',
    method: 'post',
    data: params,
    responseType: 'blob',
    timeout:timeout
  })
}

// 查询体检项对象.测量结果
export function getHealthRiskRuleTypeApi(params) {
  let url = '/aus/healthRiskRule/getHealthRiskRuleType'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 查询疾病名称
export function getDiseaseNameApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/dataDict/getDiseaseName',
    method: 'post',
    data: params,
    timeout:timeout
  })
}
/* end */

/* ---特殊评分项  start */
// 特殊评分规则
export function getSpecialScoreRuleApi(params) {
  let url = '/aus/specialScoreRule/getSpecialScoreRule'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 删除特殊评分规则
export function delSpecialScoreRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/specialScoreRule/delSpecialScoreRule?diseaseRuleID=' + params,
    method: 'post',
    timeout:timeout
  })
}

// 特殊评分规则保存（覆盖）
export function saveSpecialScoreRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/specialScoreRule/saveSpecialScoreRule',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 特殊评分规则保存（新版本）
export function saveNewSpecialScoreRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/specialScoreRule/saveNewSpecialScoreRule',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查看特殊评分规则所有版本
export function getSpecialScoreRuleVersionApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/specialScoreRule/getSpecialScoreRuleVersion',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 导出特殊评分规则
export function importSpecialScoreRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/specialScoreRule/importSpecialScoreRule',
    method: 'post',
    data: params,
    responseType: 'blob',
    timeout:timeout
  })
}
/* end */

/* ---核保评点项  start */
// 核保评点规则
export function getUnderwritingEvaluationRuleApi(params) {
  let url = '/aus/underwritingEvaluationRule/getUnderwritingEvaluationRule'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 删除核保评点规则
export function delUnderwritingEvaluationRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/underwritingEvaluationRule/delSpecialScoreRule?diseaseRuleID=' + params,
    method: 'post',
    timeout:timeout
  })
}

// 核保评点规则保存（覆盖）
export function saveUnderwritingEvaluationRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/underwritingEvaluationRule/saveUnderwritingEvaluationRule',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 核保评点规则保存（新版本）
export function saveNewUnderwritingEvaluationRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/underwritingEvaluationRule/saveNewUnderwritingEvaluationRule',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查看核保评点规则所有版本
export function getUnderwritingEvaluationRuleVersionApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/underwritingEvaluationRule/getUnderwritingEvaluationRuleVersion',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 导出核保评点规则
export function importUnderwritingEvaluationRuleApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/underwritingEvaluationRule/importUnderwritingEvaluationRule',
    method: 'post',
    data: params,
    responseType: 'blob',
    timeout:timeout
  })
}
/* end */

// 根据字典名称获取所有的字典项目
export function getNameDictProjectApi(params) {
  let url = '/aus/dataDict/getNameDictProject'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 根据字典名称获取所有的字典项目
export function getCodeDictProjectApi(params) {
  let url = '/aus/dataDict/getCodeDictProject'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 根据字典id获取所有的字典项目
export function getDictProjectApi(params) {
  let url = '/aus/dataDict/getDictProject'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

// 根据字典编码获取所有的字典项目
export function getOwnDictProjectApi(params) {
  let url = '/aus/dataDict/getOwnDictProject'
  Object.keys(params).forEach((key,index) => {
    if(index == 0) url = `${url}?${key}=${params[key]}`
    else url = `${url}&${key}=${params[key]}`
  })
  return request({
    url: appName.AUSCONFING + url,
    method: 'post',
    timeout:timeout
  })
}

/* ---规则发布  start */
// 查询规则左侧菜单
export function getRulePublishMenuApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/rulePublish/getRulePublishMenu',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查询规则发布
export function getRulePublishListApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/rulePublish/getRulePublishList',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 查询规则包详情
export function getRulePackageDetailApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/rulePublish/getRulePackageDetail',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 新增规则包
export function insertRulePublishApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/rulePublish/insertRulePublish',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 保存规则包
export function saveRulePublishApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/rulePublish/saveRulePublish',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 发布规则包
export function publishRulePublishApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/rulePublish/publishRulePublish',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除规则包
export function delRulePublishApi(params) {
  return request({
    url: appName.AUSCONFING + '/aus/rulePublish/delRulePublish?id=' + params,
    method: 'post',
    timeout:timeout
  })
}
/* end */